<?php
namespace app\common\validate;

use think\Validate;

class CheckRuleValidate extends Validate
{
    protected $rule =   [
        'name|名称'            => 'require|length:2,20',
        'section_ids|适用部门' => 'require',
        'start_time|上班时间'  => 'require',
        'end_time|下班时间'    => 'require',
    ];
    
    protected $scene = [
        /** admin */
        'add'    => ['name', 'section_ids', 'start_time', 'end_time'],
        'edit'   => ['id', 'name', 'section_ids', 'start_time', 'end_time'],
    ];
}